package com.code.soulnetty.modbus.biz.resp;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * yanggao 数据
 *
 * @author jdy
 * @date 11:40 上午
 **/
@Getter
@Setter
@ToString
public class DefaultUploadData {
    @JsonIgnore
    private String tenantId;
    @JsonProperty("device_id")
    private String guid;
    private String idc;
    @JsonProperty("device_type")
    private String deviceType;
    private String block;
    /**
     * 测点的采集时间(单位：毫秒)
     */
    private long timestamp;
    private List<DefaultUploadPointData> points;

    public DefaultUploadData(String guid) {
        this.guid = guid;
        this.points = new ArrayList<>();
    }

    public DefaultUploadData() {
    }

    @Getter
    @Setter
    @ToString
    public static class DefaultUploadPointData {
        /**
         * 测点的实时值
         */
        private Double value;
        /**
         * 测点的采集时间(单位：毫秒)
         */
        private long timestamp;
        /**
         * 对应code编码
         */
        @JsonProperty("point_code")
        private int pointCode;
    }
}
